package cn.buddha.jeres.provider.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 友野浩二
 * @Description 服务提供者测试
 * @Version 1.0
 */
@RestController
@Slf4j
public class TongController {

    // http://127.0.0.1:8001/loveanswer?requestName=shihao
    @RequestMapping(method = RequestMethod.GET, value = "/loveanswer")
    public String loveAnswer(@RequestParam(value = "requestName") String requestName) {
        log.info("Do you love me ?");
        if ("shihao".equals(requestName)) {
            return "YES! I LOVE YOU!!!";
        }
        return "NO!";
    }

}
